/**
 * 表单设计--绑定页签
 */

mini.parse();
var grid = mini.get("grid1");

function SetData(data) {
    console.log(data);
    grid.setData(data);
}

//确定按钮之前
function onTableOk() {
    var record = grid.getSelected();
    if(record) {
        return record; //返回选中的数据给父组件
    }else {
        mini.alert('请选择页签！');
        return;
    }
}

//确定按钮
function onOk(e) {
   CloseWindow("ok");
}
//取消按钮
function onCancel(e) {
    CloseWindow("cancel");
}

function CloseWindow(action) {
    if (window.CloseOwnerWindow)
        return window.CloseOwnerWindow(action);
    else
        window.close();
}
